//-----------------------------------------------------------------------------
//
// CodeXS - Copyright(c) Businessware Architects cc
// Contact: Willem J Fourie
// E-mail : willemf@bware.biz
//
// This file is part of CodeXS.
//
// CodeXS is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License (GPL) as 
// published by the Free Software Foundation version 2 of the License.
//
// CodeXS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with CodeXS; if not, write to:
//
// Free Software Foundation, Inc.
// 59 Temple Place
// Suite 330
// Boston
// MA  02111-1307  USA
//
//-----------------------------------------------------------------------------

using System;
using System.Reflection;

namespace CodeXS.Schema
{
	public class Information
	{
		static public string Version(Assembly Asm)
		{
			return Asm.GetName().Version.ToString(4);
		}
		static public string Version()
		{
			return Information.Version(Assembly.GetCallingAssembly());
		}
		static public string[] DefaultName(object Obj)
		{
			Type type = Obj.GetType();
			string[] name = new string[2];
			name[0] = type.FullName.Replace(type.Name, "");
			if(name[0][name[0].Length - 1] == '.')
			{
				name[0] = name[0].Substring(0, name[0].Length - 1);
			}
			name[1] = type.Name;
			return name;
		}
	}
}
